package com.cms.admin.util;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class PropertiesService {
 
	private static final String BUNDLE_NAME = "resources";

	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, new Locale("zh","CN"));

	private PropertiesService() {
	}

	public static String getString(String key) {
		try {
			
		 
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			
			
			e.printStackTrace();
			return '!' + key + '!';
		}
	}

	public static int getInteger(String key, int defaultInt) {
		try {
			return Integer.valueOf(RESOURCE_BUNDLE.getString(key));
		} catch (MissingResourceException e) {
			e.printStackTrace();
			return defaultInt;
		}
	}
}
